import request from '@/config/axios'

// 商家抖音账号 VO
export interface MerchantDouyinVO {
  id: number // 主键ID
  merchantId: number // 商家ID
  douyinId: string // 抖音账号ID
  accountName: string // 账号名称
  accountType: number // 账户类型
  status: number // 状态
}

// 商家抖音账号 API
export const MerchantDouyinApi = {
  // 查询商家抖音账号分页
  getMerchantDouyinPage: async (params: any) => {
    return await request.get({ url: `/juliang/merchant-douyin/page`, params })
  },

  // 查询商家抖音账号详情
  getMerchantDouyinById: async (id: number) => {
    return await request.get({ url: `/juliang/merchant-douyin/getById?id=` + id })
  },

  // 新增商家抖音账号
  createMerchantDouyin: async (data: MerchantDouyinVO) => {
    return await request.post({ url: `/juliang/merchant-douyin/create`, data })
  },

  // 修改商家抖音账号
  updateMerchantDouyin: async (data: MerchantDouyinVO) => {
    return await request.post({ url: `/juliang/merchant-douyin/update`, data })
  },

  // 修改商家抖音账号状态
  updateMerchantDouyinStatus: async (id: number, status: number) => {
    const data = {
      id,
      status
    }
    return await request.post({ url: `/juliang/merchant-douyin/updateStatus`, data: data })
  },

  // 删除商家抖音账号
  deleteMerchantDouyinById: async (id: number) => {
    return await request.get({ url: `/juliang/merchant-douyin/delete?id=` + id })
  },

  // 导出商家抖音账号 Excel
  exportMerchantDouyin: async (params) => {
    return await request.download({ url: `/juliang/merchant-douyin/export-excel`, params })
  },
}
